const express = require('express');
const router = express.Router();
const constants = require('../db/constants')

const channelController = require('../controller/v1/channel');

/**
 * @api {get} /channel/list 查询设备列表
 * @apiDescription 查询设备列表
 * @apiName ChannelList
 * @apiGroup 设备管理
 * @apiVersion 1.0.0
 */
router.get(constants.version + 'channel/list', channelController.list);

/**
 * @api {post} /channel/deleteByChannelDevice 删除设备某个通道
 * @apiDescription 删除设备某个通道
 * @apiName deleteByChannelDevice
 * @apiGroup 设备管理
 * @apiVersion 1.0.0
 */
router.post(constants.version + 'channel/deleteByChannelDevice', channelController.deleteByChannelDevice);

/**
 * @api {get} /channel/bye 停止播放
 * @apiDescription 停止播放
 * @apiName ChannelBye
 * @apiGroup 设备管理
 * @apiVersion 1.0.0
 */
router.get(constants.version + 'channel/bye', channelController.bye);
/**
 * @api {get} /channel/snap 截屏
 * @apiDescription 截屏
 * @apiName Snap
 * @apiGroup 设备管理
 * @apiVersion 1.0.0
 */
router.get(constants.version + 'channel/snap', channelController.snap);

/**
 * @api {get} /channel/registry 打印连接信息
 * @apiDescription 打印连接信息
 * @apiName Registry
 * @apiGroup 设备管理
 * @apiVersion 1.0.0
 */
router.get(constants.version + 'channel/registry', channelController.registry);

router.get(constants.version + 'channel/zoom', channelController.zoom);
router.get(constants.version + 'channel/move', channelController.move);
/**
 * @api {get} /channel/sendGbRecordListCommand 发查询录像列表指令
 * @apiDescription 发查询录像列表指令
 * @apiName sendGbRecordListCommand
 * @apiParam {String} deviceId 设备ID
 * @apiParam {String} channelId 通道ID
 * @apiParam {String} startTime 开始时间
 * @apiParam {String} endTime 结束时间
 * @apiGroup 设备管理
 * @apiVersion 1.0.0
 */
router.get(constants.version + 'channel/sendGbRecordListCommand', channelController.sendGbRecordListCommand);

/**
 * @api {get} /channel/getRecordList 获取录像列表
 * @apiDescription 获取录像列表
 * @apiName getRecordList
 * @apiParam {String} SN 发送查询录像列表命令返回的SN
 * @apiGroup 设备管理
 * @apiVersion 1.0.0
 * @apiSuccessExample {json} 成功返回:
 */
router.get(constants.version + 'channel/getRecordList', channelController.getRecordList);

module.exports = router;